package com.gmrz.service.challengestore;

import com.gmrz.uaf.protocol.v1.schema.WhiteList;
import java.util.*;

public interface ChallengeStoreService {

	void init(Properties paramProperties)
			throws ChallengeStoreException;

	void initCache(Properties props) throws ChallengeStoreException;

	IChallengeData get(String paramString)
			throws IllegalArgumentException, ChallengeStoreException;


	String getvalue(String keyvalue) throws  IllegalArgumentException, ChallengeStoreException;

	String put(IChallengeData paramIChallengeData)
			throws ConcurrentModificationException, ChallengeStoreException;

	void putvalue(String key, HashMap<String, String> value)
			throws ChallengeStoreException;
	public List<String> getvalue(String key,String... fields) throws ChallengeStoreException;

	void putString(String key, String value) throws ChallengeStoreException;

	String update(IChallengeData paramIChallengeData)
			throws ConcurrentModificationException, ChallengeStoreException;

	void delete(String paramString)
			throws ConcurrentModificationException, ChallengeStoreException;

	void shutdown() throws ChallengeStoreException;

    List<WhiteList> getWhiteList(String key) throws ChallengeStoreException;
    void setWhiteList(String key, List<WhiteList> list) throws ChallengeStoreException;
	void setRedisValue(String key, int seconds, String value) throws ChallengeStoreException ;
	String getRedisValue(String key) throws ChallengeStoreException;
	void setrangeRedisValue(String key, String value) throws ChallengeStoreException ;

    void deleteRedisValue(String key) throws ChallengeStoreException;
	public void sadd(String key,String... members) throws ChallengeStoreException;
	public Set<String> smembers(String key) throws ChallengeStoreException;
	public boolean tryGetDistributedLock(String lockKey, String requestId, int expireTime) throws ChallengeStoreException;
	public boolean releaseDistributedLock(String lockKey, String requestId) throws ChallengeStoreException ;
	public void updateCertNumCache() throws ChallengeStoreException;
	public long incr(String key) throws ChallengeStoreException;
	public long decr(String key) throws ChallengeStoreException;
	public void deleteAll(String key) throws ChallengeStoreException;
	public long expire(String key,int seconds) throws ChallengeStoreException;

}
